package soccer.stats

import com.google.common.base.Objects

class Person {
    String name
    Date dateOfBirth
    String birthPlace

    static hasMany = [
            playerHistories: PlayerHistory
    ]

    static constraints = {
        name nullable: false
        dateOfBirth nullable: true
        birthPlace nullable: true
    }

    static mapping = {
        cache true
        playerHistories cascade: "all-delete-orphan"
    }

    def String toString() {
        return Objects.toStringHelper(this).add("Name", name).add("Date Of Birth", dateOfBirth).add("Birthplace", birthPlace).toString()
    }
}
